package com.witframework.web.servlet;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.URLEncoder;
import java.util.Date;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Random;
import java.util.Vector;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpUtils;
/**
 * Slide servlet 3.0
 * 
 * <PRE>
 *  Slide servlet 3.0
 * 
 *  It is a Java servlet allows you to share documents. How does it work? Run the servlet. On the main screen you can create some topic (channel, presentation). Type the name (let it be Acme presentation) and any password you will associate with this topic. As soon as you do that, everybody who is running the same servlet will be able to join  this topic (channel). They do not need password for this. Run the same servlet from the another box (or just simply in the another window). Join to Acme presentation topic. Go back to the main window, type some URL, e.g. http://www.servletsuite.coml (you can choose any of course) and press Go button. See - the same page will be opened in the any window is joined to this topic ! The browser on the client side doesn't need to be refreshed, your client will see the same page entered in your window without his doing anything! Type another URL, (show your next slide), and again your client will see it! In other words, it is similar to PUSH. This is a main idea.
 * 
 *  Features:
 * 
 *  1. You can create script file with your slides. It is a text file located anywhere on your local box or on your server. Each line describes one slide (empty lines and lines starts with # or // are ignored) in the tab-separated format:
 * 
 * 
 *  URL    Any mnemonic name
 * 
 *  E.g.:
 * 
 * 
 *  http://www.sun.com    Main Sun's site
 *  http://java.sun.com    Main Java page
 *  // etc.
 * 
 *  Press Browse button, select your file and press Read  button. Now you can select pages from the list.
 * 
 *  2. You can share local files. E.g. select any .doc file in the master window. The same Word document will be opened in the any joined browser.
 * 
 *  3. As a presentation creator you can any time return back to the topic page (Re-enter) using the password you choose for this topic.
 * 
 *  4. You can manage all topics using administrators password. See below how to set this password.
 * 
 *  5. You can talk with presentation owner or with all participants (chat mode). This feature allows you for example surf the Net together with your friends and discuss visited sites.
 * 
 *  How to use it:
 * 
 *  a) copy slidePackage.jar into your WEB-INF/lib directory.
 * 
 *  b) define SlideServlet in your web.xml file:
 * 
 * 
 *  &lt;servlet&gt;
 *  &lt;servlet-name&gt;SlideServlet&lt;/servlet-name&gt;
 *  &lt;servlet-class&gt;com.jsos.slide.SlideServlet&lt;/servlet-class&gt;
 *  &lt;/servlet&gt;
 * 
 *  c) define a mapping:
 * 
 * 
 *  &lt;servlet-mapping&gt;
 *  &lt;servlet-name&gt;SlideServlet&lt;/servlet-name&gt;
 *  &lt;url-pattern&gt;/servlet/SlideServlet&lt;/url-pattern&gt;
 *  &lt;/servlet-mapping&gt;
 * 
 *  the usage is:
 * 
 * 
 *  http://your_host/servlet/SlideServlet
 * 
 *  Configuration file for your slide show must be included as an initial parameter for this servlet. Parameter name is config. So in your web.xml you must have some like this:
 * 
 * 
 *  &lt;servlet&gt;
 *  &lt;servlet-name&gt;SlideServlet&lt;/servlet-name&gt;
 *  &lt;servlet-class&gt;com.jsos.slide.SlideServlet&lt;/servlet-class&gt;
 *  &lt;init-param&gt;
 *  &lt;param-name&gt;config&lt;/param-name&gt;
 *  &lt;param-value&gt;path_to_your_configuration_file&lt;/param-value&gt;
 *  &lt;/init-param&gt;
 *  &lt;/servlet&gt;
 * 
 *  Configuration file is a text file, each line describes one parameter in the form of
 * 
 *  param=value
 * 
 *  Empty lines and any line starts with # or // are ignored. Current version supports the following list of parameters:
 * 
 *  # working directory (cache) on your server. This parameter is mandatory
 *  # Note: servlet will use specified working directory for
 *  # temp files only and all files from this directory will be deleted
 *  dir=some_server_directory
 * 
 *  # administrator's password. Default value is welcome
 *  admin=your_secret_word
 * 
 *  # frames (how to split screen).
 * 
 *  # master screen. Default value is 65%,35%
 *  frame1=70%,30%
 * 
 *  # slave screen. Default value 80,*
 *  frame2=70,*
 * 
 *  # chat screen. Default value is 80%,20%
 *  frame3=80%,20%
 * 
 *  # screen's background (default value is #FFFFFF)
 *  bgcolor=#FFFFFF
 * 
 *  # screen's foreground (default value is #000000)
 *  forecolor=#000000
 * 
 *  # font size (by default is current browser's font)
 *  size=2
 * 
 *  # font face (by default is current browser's font settings)
 *  face=Arial,Times
 * 
 *  # server side file with scripts (or directory with text files)
 *  # By default this parameter is empty and you will be able
 *  # to load script file from your local drive.
 *  script=your_file_or_directory
 * 
 *  # title. Default value is 'Coldbeans slide'
 *  title=My slides
 * 
 *  # head. You can set here some file contains any html-code. This code will be
 *  # outputted at the beginning of the each page. So you can set for example some banners.
 *  # By default this value is empty
 *  header=path_to_your_file
 * 
 *  # timeout (client's refresh time) in seconds. By default this value is 15
 *  timeout=15
 * 
 *  # How to open non-html document. 0 - open in the browser, 1 - open in the
 *  # separate window. Default value is 0
 *  window=0
 * 
 *  # Collaboration mode. 0 - only owner can suggest new sites/documents.
 *  # 1 - any participant can suggest new site/document.
 *  # Default value is 0
 *  mode=0
 * 
 *  # How to logout. 0 - keep your topic, 1 - close topic after logout.
 *  # Default value is 0
 *  logout=0
 * 
 *  # Chat mode. Default value is 0 (no chat). 1 - chat is on
 *  chat=1
 * 
 *  # You may set parameters for chat's window as a set of JavaScript's attributes.
 *  # chatwindow1 - for owner's chat
 *  # chatwindow2 - for client's chat
 *  # Default values are:
 *  # chatwindow1=width=530,height=400,location=no,toolbar=no,menubar=no,scrollbars=yes,resize=yes,top=30,left=30
 *  # chatwindow2=width=630,height=400,location=no,toolbar=no,menubar=no,scrollbars=yes,resize=yes,top=30,left=30
 *  # E.g.:
 *  chatwindow1=width=300,top=100,left=50
 * 
 *  # enable/disable DHTML for chat. Default value is 1 (enabled).
 *  # For old browsers you may disable this
 *  dhtml=0
 * 
 *  # chat's timeout in seconds. Default value is 10
 *  timeout1=10
 * 
 *  # In the chat you can use special color for owner's messages.
 *  # Default value is #FF0000 (red).
 *  forecolor1=#FF0000
 * 
 *  # Messages per screen in the chat. Default value is 30.
 *  messages=20
 * 
 *  # Size for messages input field in the chat. Default value is 35.
 *  msglen=40
 * 
 *  # localization support. You can set character encoding for input parameters
 *  # here. Default value is ISO-8859-1
 *  encoding=Cp1251
 * 
 *  # log file. You can provide here a name for your text file for logging
 *  # all the activity. By default this parameter is empty (no log).
 *  # Log file record format: topic, the name of your script file, URL, time stamp
 *  log=your_file_here
 * 
 *  # log file for chat. You can provide here a name for your text file for logging
 *  # all the messages from chats. By default this parameter is empty (no log).
 *  # Log file record format: topic, user name, message, time stamp
 *  chatlog=your_file_here
 * 
 *  # how to proceed records selected from the script file.
 *  # If this parameter is 1 than as soon as you select some page from
 *  # the script your topic will be automatically redirected to that page.
 *  # Otherwise you will be able to edit your selection and press Go after that.
 *  # Default value is 0.
 *  fastclick=1
 * 
 *  # how to display available pages in the selected script.
 *  # If this parameter is 0 than slides will be visible in the dropdown list.
 *  # If this parameter is 1 than slides will be visible in the Prev -Next style.
 *  # Default value is 0.
 *  pages=0
 * 
 *  # translation. You can provide here a path to some text file with your
 *  # own static text labels. This feature lets you for example translate
 *  # (localize) user interface.
 *  translation=path_to_your_file
 * 
 * 
 *  Notes:
 * 
 *  1. Slide's configuration file can be saved anywhere on your server. Just set the proper path in your web.xml file.
 * 
 *  2. Evaluation version restricts size for your script files.
 * 
 *  More about scripts
 * 
 *  Script is a text file with a list of slides (some like scenario). You can load such text files from your local drive or from your server. Parameter script can describe a path to some text file (script) on your server or a path to some directory on your server. In case of directory servlet lets you load all the files with .txt extension from the given directory.
 *  Without the parameter script (default behavior) you will be able to load files (scripts) from your local drive.
 * 
 *  Customization
 * 
 *  You may rewrite the initial dialogue. All functions (create a topic, re-open existing topic, join to topic) may be incorporated into your own pages. For running system functions you should just post appropriate data to SlideServlet.
 * 
 *  administrative console:
 *  You have to post two parameters: wrk and pass. The first parameter must have value admin, and the second is administrator's password.
 * 
 *  create a new topic:
 *  You have to post four parameters: wrk, tpc1, pass and pass1 The first parameter must have value create, the second is session's name and the last two parameters are equals and the value is session's password.
 * 
 *  join to existing topic:
 *  You have to post two parameters: wrk and tpc. The first parameter must have value jn, and the second is session's name.
 * 
 *  re-open existing topic:
 *  You have to post three parameters: wrk, tpc and pass The first parameter must have value rntr, the second is session's name and the last one is session's password.
 * 
 *  close (delete) existing topic:
 *  You have to post three parameters: wrk, tpc and pass The first parameter must have value close, the second is session's name and the last one is session's password.
 * 
 *  for example this HTML code connects user to the session 'test':
 * 
 * 
 *  &lt;form method=&quot;post&quot; action=&quot;http://your_host/servlet/SlideServlet&quot;&gt;
 *  &lt;input type=&quot;hidden&quot; name=&quot;wrk&quot; value=&quot;jn&quot;&gt;
 *  &lt;input type=&quot;hidden&quot; name=&quot;tpc&quot; value=&quot;test&quot;&gt;
 *  &lt;/form&gt;
 *  ...
 *  &lt;script language=&quot;JavaScript&quot;&gt;
 *  document.forms[0].submit();
 *  &lt;/script&gt;
 * 
 *  Translation.
 * 
 *  It is a text file, each line looks like so:
 * 
 *  standard_key=your_repalcement
 * 
 *  Keys are: Topic, Url, File, Script, Chat, Logout, Clear, Read file, Read script, Go
 * 
 *  For example, your file may define so:
 * 
 * 
 *  Url=Website
 *  File=Send File
 *  Script=My presentation
 *  etc.
 * 
 * 
 * 
 *  For downloading:   slidePackage.jar
 * 
 *  © Coldbeans     Comments?
 * 
 *  See also JSOS - the largest collection of servlets and filters. 
 * </PRE>
 * 
 * @author wuxinyang Aug 21, 2009 10:07:44 AM
 */
/*
 * SlideServlet - Decompiled by JODE Visit http://jode.sourceforge.net/
 */



public class SlideServlet extends HttpServlet {
	public static Object forLock = new Object();
	public static Object SessionIdLock = new Object();
	private static final int HOW_LONG = 6;
	private static final int CLIENT_DELAY1 = 20000;
	private static final int CLIENT_DELAY2 = 25000;
	private static final String VERSION = "ver. 3.0";
	private static final String CPR = "&nbsp;&copy;&nbsp;&nbsp;";
	private static final String DEFBGCOLOR = "#FFFFFF";
	private static final String DEFFORECOLOR = "#000000";
	private static final String DEFFORECOLOR1 = "#FF0000";
	private static final String DEFTITLE = "Coldbeans slide";
	private static final String DEFTIMEOUT = "15000";
	private static final String DEFTIMEOUT1 = "5000";
	private static final String DEFWINDOW = "0";
	private static final String DEFCHAT = "0";
	private static final String DEFENCODING = "ISO-8859-1";
	private static final String DEFMESSAGES = "30";
	private static final String DEFMODE = "0";
	private static final String DEFDHTML = "1";
	private static final String DEFMSGLEN = "35";
	private static final String DEFFASTCLICK = "0";
	private static final String DEFCHATWINDOW1 = "width=530,height=400,location=no,toolbar=no,menubar=no,scrollbars=yes,resize=yes,top=30,left=30";
	private static final String DEFCHATWINDOW2 = "width=630,height=400,location=no,toolbar=no,menubar=no,scrollbars=yes,resize=yes,top=30,left=30";
	private static final String DEFFRAME1 = "65%,35%";
	private static final String DEFFRAME2 = "80,*";
	private static final String DEFFRAME3 = "80%,20%";
	private static final String DEFPAGES = "0";
	private static final String DEFLOGOUT = "0";
	private static final String DICTIONARY = "lbldctnr";
	private static final String PASSWORD = "pass";
	private static final String PASSWORD1 = "pass1";
	private static final String TOPIC = "tpc";
	private static final String TOPIC1 = "tpc1";
	private static final String ACTION = "wrk";
	private static final String DELETE = "dlt";
	private static final String CURRENT = "crt";
	private static final String CLIENT = "clnt";
	private static final String PREV = "prev";
	private static final String UP = "up";
	private static final String UP1 = "up1";
	private static final String SUP = "sup";
	private static final String MIDDLE = "mddl";
	private static final String DOWN = "dwn";
	private static final String DOWN1 = "dwn1";
	private static final String EMPTY1 = "empt1";
	private static final String EMPTY2 = "empt2";
	private static final String EMPTY3 = "empt3";
	private static final String EMPTY4 = "empt4";
	private static final String GO = "go";
	private static final String GO1 = "go1";
	private static final String CLEAR = "clr";
	private static final String FNAME = "fname";
	private static final String SCRIPT = "scrpt";
	private static final String JOIN = "jn";
	private static final String CREATE = "create";
	private static final String REENTER = "rntr";
	private static final String CLOSE = "close";
	private static final String HOSTFILE = "hstfl";
	private static final String HOSTFILE1 = "hstfl1";
	private static final String REALNAME = "rlnm";
	private static final String REFRESHCHAT = "rfrcht";
	private static final String INPUTCHAT = "inptcht";
	private static final String INPUTCHAT1 = "inptcht1";
	private static final String INITCHAT = "intcht";
	private static final String EMPTYCHAT = "mptcht";
	private static final String EMPTYMAINCHAT = "mptmncht";
	private static final String CHATMESSAGE = "chtmsg";
	private static final String CHAT1 = "chat1";
	private static final String SUGGEST = "sgst";
	private static final String SUGGEST1 = "sgst1";
	private static final String SCRIPTFILENAME = "scrptflnm01";
	private static final String FICT = "fct";
	private static final String DEFADMIN = "welcome";
	private static final String BGCOLOR = "bgcolor";
	private static final String FORECOLOR = "forecolor";
	private static final String FORECOLOR1 = "forecolor1";
	private static final String BASE = "dir";
	private static final String BASE1 = "dir1";
	private static final String TITLE = "title";
	private static final String SIZE = "size";
	private static final String FACE = "face";
	private static final String HEAD = "header";
	private static final String ADMIN = "admin";
	private static final String FASTCLICK = "fastclick";
	private static final String CONFIG = "config";
	private static final String TIMEOUT = "timeout";
	private static final String TIMEOUT1 = "timeout1";
	private static final String WINDOW = "window";
	private static final String CHAT = "chat";
	private static final String ENCODING = "encoding";
	private static final String MESSAGES = "messages";
	private static final String MODE = "mode";
	private static final String DHTML = "dhtml";
	private static final String MSGLEN = "msglen";
	private static final String CHATWINDOW1 = "chatwindow1";
	private static final String CHATWINDOW2 = "chatwindow2";
	private static final String LOGOUT = "logout";
	private static final String SCRIPTFILE = "script";
	private static final String LOG = "log";
	private static final String CHATLOG = "chatlog";
	private static final String TRANSLATION = "translation";
	private static final String PAGES = "pages";
	private static final String FRAME1 = "frame1";
	private static final String FRAME2 = "frame2";
	private static final String FRAME3 = "frame3";
	private static String NEWLINE = "\n";
	private static String separator = "/";
	private Hashtable slides;
	private Hashtable conf;

	public void init(ServletConfig servletconfig) throws ServletException {
		super.init(servletconfig);
		NEWLINE = System.getProperty("line.separator");
		separator = System.getProperty("file.separator");
		conf = new Hashtable();
		slides = new Hashtable();
		String string;
		if ((string = getInitParameter("config")) != null)
			readConfig(string, conf);
		string = (String) conf.get("dir");
		if (string != null) {
			try {
				File file = new File(string);
				String[] strings = file.list();
				for (int i = 0; i < strings.length; i++) {
					file = new File(string, strings[i]);
					file.delete();
				}
			} catch (Exception exception) {
				/* empty */
			}
		}
	}

	public void doPost(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse) throws ServletException, IOException {
		doGet(httpservletrequest, httpservletresponse);
	}

	public void doGet(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse) throws ServletException, IOException {
		String string = "";
		String string_0_ = "";
		String string_1_ = null;
		string = HttpUtils.getRequestURL(httpservletrequest).toString();
		int i;
		if ((i = string.indexOf("?")) > 0)
			string = string.substring(0, i);
		string_0_ = httpservletrequest.getQueryString();
		if (string_0_ == null)
			string_0_ = "";
		if (conf.size() == 0) {
			PrintWriter printwriter = httpservletresponse.getWriter();
			httpservletresponse.setContentType("text/html");
			errorMessage("<br><br>Could not get an initial parameter with configuration file!", printwriter);
		} else if (conf.get("dir") == null) {
			PrintWriter printwriter = httpservletresponse.getWriter();
			httpservletresponse.setContentType("text/html");
			if (conf.get("dir1") == null)
				errorMessage(("<br><br>Could not get work directory from your configuation file " + conf.get("config") + "!"), printwriter);
			else
				errorMessage(("<br><br>Could not read work directory " + conf.get("dir1") + " !"), printwriter);
		} else {
			if (string_0_.length() == 0)
				string_1_ = httpservletrequest.getParameter("wrk");
			if (string_1_ == null)
				string_1_ = "";
			if (string_1_.equals("admin"))
				adminPage(httpservletrequest.getParameter("pass"), string, httpservletrequest, httpservletresponse);
			else if (string_1_.equals("rntr")) {
				String string_2_ = decodeString(httpservletrequest.getParameter("tpc"), httpservletrequest.getCharacterEncoding(), (String) conf
						.get("encoding"));
				String string_3_ = httpservletrequest.getParameter("pass");
				Hashtable hashtable;
				if ((hashtable = (Hashtable) slides.get(string_2_)) == null)
					loginPage(string, httpservletrequest, httpservletresponse);
				else if (string_3_.equals((String) hashtable.get("pass")))
					topicPage(string_2_, string, httpservletrequest, httpservletresponse);
				else
					loginPage(string, httpservletrequest, httpservletresponse);
			} else if (string_1_.equals("close")) {
				String string_4_ = decodeString(httpservletrequest.getParameter("tpc"), httpservletrequest.getCharacterEncoding(), (String) conf
						.get("encoding"));
				String string_5_ = httpservletrequest.getParameter("pass");
				Hashtable hashtable;
				if ((hashtable = (Hashtable) slides.get(string_4_)) == null)
					loginPage(string, httpservletrequest, httpservletresponse);
				else {
					if (string_5_.equals((String) hashtable.get("pass")))
						slides.remove(string_4_);
					loginPage(string, httpservletrequest, httpservletresponse);
				}
			} else if (string_1_.equals("create")) {
				String string_6_ = httpservletrequest.getParameter("pass");
				String string_7_ = httpservletrequest.getParameter("pass1");
				String string_8_ = decodeString(httpservletrequest.getParameter("tpc1"), httpservletrequest.getCharacterEncoding(), (String) conf
						.get("encoding"));
				string_6_ = string_6_.trim();
				string_7_ = string_7_.trim();
				string_8_ = string_8_.trim();
				if (string_7_.equals(string_6_) && string_8_.length() > 0)
					newTopicPage(string_8_, string_6_, string, httpservletrequest, httpservletresponse);
				else
					loginPage(string, httpservletrequest, httpservletresponse);
			} else if (string_1_.equals("dlt"))
				deleteTopic(string, httpservletrequest, httpservletresponse);
			else if (string_1_.equals("clr"))
				clearCache(decodeString(httpservletrequest.getParameter("tpc1"), httpservletrequest.getCharacterEncoding(), (String) conf
						.get("encoding")), httpservletresponse);
			else if (string_1_.equals("go"))
				goPage(
						decodeString(httpservletrequest.getParameter("tpc1"), httpservletrequest.getCharacterEncoding(), (String) conf
								.get("encoding")), httpservletrequest.getParameter("fname"), httpservletrequest.getParameter("mode"), string,
						httpservletrequest.getParameter("scrptflnm01"), httpservletresponse);
			else if (string_1_.equals("logout")) {
				String string_9_ = decodeString(httpservletrequest.getParameter("tpc1"), httpservletrequest.getCharacterEncoding(), (String) conf
						.get("encoding"));
				slides.remove(string_9_);
				loginPage(string, httpservletrequest, httpservletresponse);
			} else if (string_1_.equals("jn"))
				joinTopic(decodeString(httpservletrequest.getParameter("tpc"), httpservletrequest.getCharacterEncoding(), (String) conf
						.get("encoding")), string, httpservletresponse);
			else {
				string_1_ = getFromQuery(string_0_, "wrk=");
				if (string_1_.equals("empt1"))
					upTopicFrame(httpservletresponse);
				else if (string_1_.equals("empt2"))
					middleTopicFrame(string, getFromQuery(string_0_, "tpc="), httpservletresponse);
				else if (string_1_.equals("empt3"))
					downTopicFrame(getFromQuery(string_0_, "tpc="), string, null, httpservletresponse);
				else if (string_1_.equals("empt4"))
					middleTopicFrame(string, getFromQuery(string_0_, "tpc="), httpservletresponse);
				else if (string_1_.equals("scrpt"))
					acceptScript(getFromQuery(string_0_, "tpc="), string, httpservletrequest, httpservletresponse);
				else if (string_1_.equals("clnt"))
					clientPage(getFromQuery(string_0_, "tpc="), getFromQuery(string_0_, "crt="), string, httpservletresponse);
				else if (string_1_.equals("hstfl"))
					acceptHostFile(getFromQuery(string_0_, "tpc="), getFromQuery(string_0_, "mode="), string, httpservletrequest, httpservletresponse);
				else if (string_1_.equals("hstfl1"))
					showHostFile(getFromQuery(string_0_, "tpc="), getFromQuery(string_0_, "fname="), httpservletresponse);
				else if (string_1_.equals("go1"))
					duplicateFrame(getFromQuery(string_0_, "tpc="), string, httpservletresponse);
				else if (string_1_.equals("chat"))
					mainChat(getFromQuery(string_0_, "tpc="), string, httpservletresponse);
				else if (string_1_.equals("chat1"))
					mainChat1(getFromQuery(string_0_, "tpc="), string, httpservletresponse);
				else if (string_1_.equals("inptcht"))
					inputChat(getFromQuery(string_0_, "tpc="), string, httpservletresponse);
				else if (string_1_.equals("inptcht1"))
					inputChat1(getFromQuery(string_0_, "tpc="), string, httpservletresponse);
				else if (string_1_.equals("rfrcht"))
					refreshChat(getFromQuery(string_0_, "tpc="), getFromQuery(string_0_, "crt="), string, httpservletresponse);
				else if (string_1_.equals("mptcht"))
					emptyChat(httpservletresponse);
				else if (string_1_.equals("mptmncht"))
					emptyMainChat(httpservletresponse);
				else if (string_1_.equals("chtmsg"))
					addChatMessage(httpservletrequest, httpservletresponse);
				else if (string_1_.equals("intcht"))
					initChat(getFromQuery(string_0_, "tpc="), string, httpservletresponse);
				else if (string_1_.equals("sgst"))
					mainSuggest(getFromQuery(string_0_, "tpc="), string, httpservletresponse);
				else if (string_1_.equals("sgst1"))
					mainSuggest1(getFromQuery(string_0_, "tpc="), string, httpservletresponse);
				else if (string_1_.equals("script"))
					acceptScriptFile(getFromQuery(string_0_, "tpc="), string, httpservletrequest, httpservletresponse);
				else
					loginPage(string, httpservletrequest, httpservletresponse);
			}
		}
	}

	private void initChat(String string, String string_10_, HttpServletResponse httpservletresponse) throws IOException {
		String string_11_ = (String) conf.get("chat");
		String string_12_ = (String) conf.get("mode");
		httpservletresponse.setContentType("text/html");
		PrintWriter printwriter = httpservletresponse.getWriter();
		printwriter.println("<html>");
		printwriter.println("<body bgcolor=\"D3D3D3\">");
		printwriter.print("<style type=\"text/css\">");
		printwriter.print(" a { text-decoration:none }");
		printwriter.println("</style>");
		printwriter.println("<script language=\"JavaScript\">");
		if (!string_11_.equals("0"))
			printwriter.println(mainChatScript("chat1", ((String) conf.get("chatwindow2")), string_10_, string, (String) conf.get("chat")));
		if (!string_12_.equals("0"))
			printwriter.println(mainSuggestScript("sgst", string_10_, string));
		printwriter.println("</script>");
		printwriter.println("<table width=\"100%\" border=\"0\">");
		if (!string_11_.equals("0"))
			printwriter.println("<tr><td nowrap><a href=\"javascript:openchat();\">Chat</a></td></tr>");
		if (!string_12_.equals("0"))
			printwriter.println("<tr><td nowrap><a href=\"javascript:suggest();\">Suggest</a></td></tr>");
		printwriter.println("<tr><td nowrap><a href=\"" + string_10_ + "\" target=_top>Exit</a></td></tr>");
		printwriter.println("</table>");
		printwriter.println("</body>");
		printwriter.println("</html>");
		printwriter.flush();
		printwriter.close();
	}

	private void emptyChat(HttpServletResponse httpservletresponse) throws IOException {
		httpservletresponse.setContentType("text/html");
		PrintWriter printwriter = httpservletresponse.getWriter();
		printwriter.println("<html>");
		printwriter.println("<body bgcolor=\"" + (String) conf.get("bgcolor") + "\">");
		printwriter.println(getFont(conf));
		printwriter.println("&nbsp;");
		printwriter.println("</font></body>");
		printwriter.println("</html>");
		printwriter.flush();
		printwriter.close();
	}

	private void emptyMainChat(HttpServletResponse httpservletresponse) throws IOException {
		httpservletresponse.setContentType("text/html");
		PrintWriter printwriter = httpservletresponse.getWriter();
		printwriter.println("<html>");
		printwriter.println("<head>");
		printwriter.println("<script language=\"JavaScript\">");
		printwriter.println("function ff(s)");
		printwriter.println("{ s0=document.all.tags(\"p\").item(\"chat\").innerHTML;");
		printwriter.println("  document.all.tags(\"p\").item(\"chat\").innerHTML=s+\"<br>\"+s0; }");
		printwriter.println("</script>");
		printwriter.println("</head>");
		printwriter.println("<body bgcolor=\"" + (String) conf.get("bgcolor") + "\">");
		printwriter.println(getFont(conf));
		printwriter.println("<p id=\"chat\">");
		printwriter.println("</p>");
		printwriter.println("&nbsp;");
		printwriter.println("</font></body>");
		printwriter.println("</html>");
		printwriter.flush();
		printwriter.close();
	}

	private void addChatMessage(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse) throws IOException {
		String string = (String) conf.get("encoding");
		String string_13_ = httpservletrequest.getCharacterEncoding();
		String string_14_ = decodeString(httpservletrequest.getParameter("tpc"), string_13_, string);
		String string_15_ = httpservletrequest.getParameter("clnt");
		String string_16_ = httpservletrequest.getParameter("chtmsg");
		String string_17_ = (String) conf.get("chatlog");
		Hashtable hashtable = (Hashtable) slides.get(string_14_);
		Object object = null;
		Object object_18_ = null;
		int i = Integer.parseInt((String) conf.get("messages"));
		httpservletresponse.setContentType("text/html");
		PrintWriter printwriter = httpservletresponse.getWriter();
		printwriter.println("<html>");
		if (hashtable != null) {
			string_15_ = prepareMsg(decodeString(string_15_, string_13_, string));
			if (string_15_.length() == 0)
				string_15_ = "unknown";
			string_16_ = prepareMsg(decodeString(string_16_, string_13_, string));
			if (string_16_.length() != 0) {
				Vector vector = new Vector();
				vector.addElement(getId());
				vector.addElement(new Date());
				vector.addElement(string_15_);
				vector.addElement("all");
				vector.addElement(string_16_);
				if (string_17_ != null)
					logData1(string_14_, string_17_, string_15_, string_16_);
				Vector vector_19_ = (Vector) hashtable.get("chat");
				synchronized (vector_19_) {
					while (vector_19_.size() > i)
						vector_19_.removeElementAt(0);
					vector_19_.addElement(vector);
				}
			}
			printwriter.println("<script language=\"JavaScript\">");
			printwriter.println("parent.inputchat.document.forms[0].chtmsg.value='';");
			printwriter.println("parent.inputchat.document.forms[0].chtmsg.focus();");
			printwriter.println("</script>");
		}
		printwriter.println("</html>");
		printwriter.flush();
		printwriter.close();
	}

	private void inputChat(String string, String string_21_, HttpServletResponse httpservletresponse) throws IOException {
		Hashtable hashtable = (Hashtable) slides.get(string);
		String string_22_ = getFont(conf);
		httpservletresponse.setContentType("text/html");
		PrintWriter printwriter = httpservletresponse.getWriter();
		printwriter.println("<html>");
		printwriter.println("<body bgcolor=\"" + (String) conf.get("bgcolor") + "\">");
		printwriter.println(string_22_);
		if (hashtable == null)
			printwriter.println("&nbsp;");
		else {
			printwriter.println("<form method=post action=\"" + string_21_ + "?" + "wrk" + "=" + "chtmsg" + "\" target=emptychat>");
			printwriter.println("<input type=hidden name=\"tpc\" value=\"" + string + "\">");
			printwriter.println("<input type=hidden name=\"clnt\" value=\"Owner\">");
			printwriter.println("<center>");
			printwriter.println("<table width=\"100%\" border=\"0\">");
			printwriter
					.println("<tr><td nowrap><input type=\"text\" size=\"40\" name=\"chtmsg\">&nbsp;&nbsp;<input type=submit value=\"Send\"></td></tr>");
			printwriter.println("</table>");
			printwriter.println("</center>");
			printwriter.println("</form>");
		}
		printwriter.println("</font></body>");
		printwriter.println("</html>");
		printwriter.flush();
		printwriter.close();
	}

	private void inputChat1(String string, String string_23_, HttpServletResponse httpservletresponse) throws IOException {
		Hashtable hashtable = (Hashtable) slides.get(string);
		String string_24_ = getFont(conf);
		httpservletresponse.setContentType("text/html");
		PrintWriter printwriter = httpservletresponse.getWriter();
		printwriter.println("<html>");
		printwriter.println("<body bgcolor=\"" + (String) conf.get("bgcolor") + "\">");
		printwriter.println(string_24_);
		if (hashtable == null)
			printwriter.println("&nbsp;");
		else {
			printwriter.println("<form method=\"post\" action=\"" + string_23_ + "?" + "wrk" + "=" + "chtmsg" + "\" target=emptychat>");
			printwriter.println("<input type=\"hidden\" name=\"tpc\" value=\"" + string + "\">");
			printwriter.println("<center>");
			printwriter.println("<table width=\"100%\" border=\"0\">");
			printwriter.println("<tr><td nowrap>From:<input type=\"text\" size=\"10\" name=\"clnt\">&nbsp;&nbsp;Msg:<input type=text size=\""
					+ (String) conf.get("msglen") + "\" name=\"" + "chtmsg" + "\">&nbsp;&nbsp;<input type=submit value=\"Send\"></td></tr>");
			printwriter.println("</table>");
			printwriter.println("</center>");
			printwriter.println("</form>");
		}
		printwriter.println("</font></body>");
		printwriter.println("</html>");
		printwriter.flush();
		printwriter.close();
	}

	private void refreshChat(String string, String string_25_, String string_26_, HttpServletResponse httpservletresponse) throws IOException {
		Hashtable hashtable = (Hashtable) slides.get(string);
		String string_27_ = getFont(conf);
		boolean bool = false;
		boolean bool_28_ = ((String) conf.get("dhtml")).equals("0");
		httpservletresponse.setContentType("text/html");
		PrintWriter printwriter = httpservletresponse.getWriter();
		printwriter.println("<html>");
		printwriter.println("<body bgcolor=\"" + (String) conf.get("bgcolor") + "\">");
		printwriter.println(string_27_);
		if (hashtable == null)
			printwriter.println("&nbsp;");
		else {
			Vector vector = (Vector) hashtable.get("chat");
			long l;
			if (string_25_.length() == 0)
				l = 0L;
			else
				l = Long.parseLong(string_25_);
			String string_29_ = "";
			printwriter.println("<script language=\"JavaScript\">");
			printwriter.println("var pp=parent.mainchat.window;");
			if (string_25_.length() > 0) {
				synchronized (vector) {
					for (int i = 0; i < vector.size(); i++) {
						Vector vector_31_ = (Vector) vector.elementAt(i);
						string_29_ = (String) vector_31_.elementAt(0);
						long l_32_ = Long.parseLong(string_29_);
						if (l_32_ > l) {
							if (bool_28_)
								printwriter.println("parent.mainchat.window.document.writeln('" + string_27_ + "<br>" + composeMessage(vector_31_)
										+ "</font>');");
							else
								printwriter.println("pp.ff('" + string_27_ + composeMessage(vector_31_) + "</font>');");
							bool = true;
						}
					}
				}
				if (bool && bool_28_)
					printwriter.println("parent.mainchat.window.scroll(0,600);");
			}
			printwriter.println("function fun()");
			printwriter.println("{");
			printwriter.print("location.href='" + string_26_ + "?" + "wrk" + "=" + "rfrcht" + "&" + "tpc" + "=" + URLEncoder.encode(string));
			if (string_29_.length() != 0)
				printwriter.print("&crt=" + string_29_);
			else
				printwriter.print("&crt=0");
			printwriter.println("';");
			printwriter.println("}");
			if (string_25_.length() == 0)
				printwriter.println("setTimeout(\"fun()\",500);");
			else
				printwriter.println("setTimeout(\"fun()\"," + (String) conf.get("timeout1") + ");");
			printwriter.println("</script>");
		}
		printwriter.println("</font></body>");
		printwriter.println("</html>");
		printwriter.flush();
		printwriter.close();
	}

	private void mainChat(String string, String string_33_, HttpServletResponse httpservletresponse) throws IOException {
		Hashtable hashtable = (Hashtable) slides.get(string);
		httpservletresponse.setContentType("text/html");
		PrintWriter printwriter = httpservletresponse.getWriter();
		printwriter.println("<html>");
		if (hashtable == null)
			printwriter.println("<br>Topic:" + string + " is closed");
		else {
			printwriter.println("<head>");
			printwriter.println("<title>Chat:" + (String) conf.get("title") + ":" + string + "</title>");
			printwriter.println("</head>");
			printwriter.println("<frameset rows=\"" + conf.get("frame3") + ",*,*\" border=0>");
			printwriter.println("<frame name=\"mainchat\" src=\"" + string_33_ + "?" + "wrk" + "=" + "mptmncht" + "\">" + NEWLINE);
			printwriter.println("<frame name=\"inputchat\" src=\"" + string_33_ + "?" + "wrk" + "=" + "inptcht" + "&" + "tpc" + "="
					+ URLEncoder.encode(string) + "\">" + NEWLINE);
			printwriter.println("<frame name=\"emptychat\" src=\"" + string_33_ + "?" + "wrk" + "=" + "mptcht" + "\">" + NEWLINE);
			printwriter.println("<frame name=\"hiddenchat\" src=\"" + string_33_ + "?" + "wrk" + "=" + "rfrcht" + "&" + "tpc" + "="
					+ URLEncoder.encode(string) + "\">" + NEWLINE);
			printwriter.println("</frameset>");
		}
		printwriter.println("</html>");
		printwriter.flush();
		printwriter.close();
	}

	private void mainChat1(String string, String string_34_, HttpServletResponse httpservletresponse) throws IOException {
		Hashtable hashtable = (Hashtable) slides.get(string);
		httpservletresponse.setContentType("text/html");
		PrintWriter printwriter = httpservletresponse.getWriter();
		printwriter.println("<html>");
		if (hashtable == null)
			printwriter.println("<br>Topic:" + string + " is closed");
		else {
			printwriter.println("<head>");
			printwriter.println("<title>Chat:" + (String) conf.get("title") + ":" + string + "</title>");
			printwriter.println("</head>");
			printwriter.println("<frameset rows=\"" + conf.get("frame3") + ",*,*\" border=0>");
			printwriter.println("<frame name=\"mainchat\" src=\"" + string_34_ + "?" + "wrk" + "=" + "mptmncht" + "\">" + NEWLINE);
			printwriter.println("<frame name=\"inputchat\" src=\"" + string_34_ + "?" + "wrk" + "=" + "inptcht1" + "&" + "tpc" + "="
					+ URLEncoder.encode(string) + "\">" + NEWLINE);
			printwriter.println("<frame name=\"emptychat\" src=\"" + string_34_ + "?" + "wrk" + "=" + "mptcht" + "\">" + NEWLINE);
			printwriter.println("<frame name=\"hiddenchat\" src=\"" + string_34_ + "?" + "wrk" + "=" + "rfrcht" + "&" + "tpc" + "="
					+ URLEncoder.encode(string) + "\">" + NEWLINE);
			printwriter.println("</frameset>");
		}
		printwriter.println("</html>");
		printwriter.flush();
		printwriter.close();
	}

	private void mainSuggest(String string, String string_35_, HttpServletResponse httpservletresponse) throws IOException {
		Hashtable hashtable = (Hashtable) slides.get(string);
		httpservletresponse.setContentType("text/html");
		PrintWriter printwriter = httpservletresponse.getWriter();
		printwriter.println("<html>");
		if (hashtable == null)
			printwriter.println("<br>Topic:" + string + " is closed");
		else {
			printwriter.println("<head>");
			printwriter.println("<title>Suggest:" + (String) conf.get("title") + ":" + string + "</title>");
			printwriter.println("</head>");
			printwriter.println("<frameset rows=\"100%,*\" border=\"0\">");
			printwriter.println("<frame name=\"suggested\" src=\"" + string_35_ + "?" + "wrk" + "=" + "sgst1" + "&" + "tpc" + "="
					+ URLEncoder.encode(string) + "\">\n");
			printwriter.println("<frame name=\"sup\" src=\"" + string_35_ + "?" + "wrk" + "=" + "empt1" + "\">\n");
			printwriter.println("</frameset>");
		}
		printwriter.println("</html>");
		printwriter.flush();
		printwriter.close();
	}

	private void mainSuggest1(String string, String string_36_, HttpServletResponse httpservletresponse) throws IOException {
		Hashtable hashtable = (Hashtable) slides.get(string);
		String string_37_ = getFont(conf);
		httpservletresponse.setContentType("text/html");
		PrintWriter printwriter = httpservletresponse.getWriter();
		printwriter.println("<html>");
		if (hashtable == null)
			printwriter.println("<br>Topic:" + string + " is closed");
		else {
			printwriter.println("<body>");
			printwriter.println(string_37_);
			printwriter.println("<form method=\"post\" action=\"" + string_36_ + "\" target=\"" + "sup" + "\">");
			printwriter.println("<input type=hidden name=\"wrk\" value=\"go\">");
			printwriter.println("<input type=hidden name=\"tpc1\" value=\"" + string + "\">");
			printwriter.println("<input type=hidden name=\"mode\" value=\"1\">");
			printwriter.println("<table width=\"100%\" border=\"0\">");
			printwriter.println("<tr><td nowrap width=\"60%\">" + string_37_);
			printwriter.print("URL:&nbsp;<input type=\"text\" name=\"fname\" size=\"40\"");
			String string_38_;
			if ((string_38_ = (String) hashtable.get("crt")) != null && string_38_.indexOf("fname=") < 0)
				printwriter.print(" value=\"" + string_38_ + "\"");
			printwriter.println("></font></td>");
			printwriter.println("<td nowrap>" + string_37_ + "<input type=submit value=\"Go\"></font></td>");
			printwriter.println("</tr></table></form>");
			printwriter.println("<table width=\"100%\" border=\"0\">");
			printwriter.println("<tr>");
			printwriter.println("<form method=\"post\" enctype=\"multipart/form-data\" action=\"" + string_36_ + "?" + "wrk" + "=" + "hstfl" + "&"
					+ "tpc" + "=" + URLEncoder.encode(string) + "&" + "mode" + "=" + "1" + "\" target=\"" + "sup" + "\">");
			printwriter.println("<td nowrap align=\"right\">" + string_37_ + "File:</font></td>");
			printwriter.print("<td nowrap>" + string_37_ + "<input type=\"file\" name=\"" + "fname" + "\">&nbsp;&nbsp;");
			printwriter.println("<input type=\"submit\" value=\"Read\"></font></td></form></tr></table>");
			printwriter.println("</font>");
			printwriter.println("</body>");
		}
		printwriter.println("</html>");
		printwriter.flush();
		printwriter.close();
	}

	private void duplicateFrame(String string, String string_39_, HttpServletResponse httpservletresponse) throws IOException {
		PrintWriter printwriter = httpservletresponse.getWriter();
		Hashtable hashtable = (Hashtable) slides.get(string);
		String string_40_ = null;
		if (hashtable != null)
			string_40_ = (String) hashtable.get("crt");
		httpservletresponse.setContentType("text/html");
		printwriter.println("<frameset rows=\"100%,*\" border=\"0\">");
		if (string_40_ == null)
			printwriter.println("<frame src=\"" + string_39_ + "?" + "wrk" + "=" + "empt1" + "\">");
		else
			printwriter.println("<frame src=\"" + string_40_ + "\">");
		printwriter.println("<frame src=\"" + string_39_ + "?" + "wrk" + "=" + "empt1" + "\">");
		printwriter.println("</frameset>");
		printwriter.flush();
		printwriter.close();
	}

	private void acceptHostFile(String string, String string_41_, String string_42_, HttpServletRequest httpservletrequest,
			HttpServletResponse httpservletresponse) throws IOException {
		Hashtable hashtable = (Hashtable) slides.get(string);
		String[] strings = uploadFile(httpservletrequest, string);
		if (hashtable != null)
			hashtable.put(strings[0], strings[1]);
		goPage(string, strings[0], string_41_.length() == 0 ? null : string_41_, string_42_, httpservletrequest.getParameter("scrptflnm01"),
				httpservletresponse);
	}

	private void showHostFile(String string, String string_43_, HttpServletResponse httpservletresponse) throws IOException {
		String string_44_ = null;
		String string_45_ = (String) conf.get("dir");
		String string_46_ = string_45_ + string_43_;
		Hashtable hashtable = (Hashtable) slides.get(string);
		if (hashtable != null)
			string_44_ = getFromHash(hashtable, string_46_);
		if (string_44_ == null) {
			httpservletresponse.setContentType("text/html");
			PrintWriter printwriter = httpservletresponse.getWriter();
			printwriter.println("<html>");
			printwriter.println("<br>Could not show this file");
			printwriter.println("</html>");
			printwriter.flush();
			printwriter.close();
		} else {
			String string_47_ = getContentType(string_44_);
			javax.servlet.ServletOutputStream servletoutputstream = httpservletresponse.getOutputStream();
			httpservletresponse.setContentType(string_47_);
			if (!IsTextType(string_47_)) {
				if (((String) conf.get("window")).equals("1"))
					httpservletresponse.setHeader("Content-disposition", ("attachment;filename=" + getFileName(string_44_)));
				else
					httpservletresponse.setHeader("Content-disposition", ("inline;filename=" + getFileName(string_44_)));
			}
			dumpFile(string_46_, servletoutputstream);
			servletoutputstream.flush();
			servletoutputstream.close();
		}
	}

	private boolean IsTextType(String string) {
		if (string.equals("text/html"))
			return true;
		if (string.equals("text/plain"))
			return true;
		if (string.equals("text/xml"))
			return true;
		return false;
	}

	private String getFileName(String string) {
		int i = string.lastIndexOf("\\");
		if (i < 0 || i >= string.length() - 1)
			i = string.lastIndexOf("/");
		if (i < 0 || i >= string.length() - 1)
			return string;
		return string.substring(i + 1);
	}

	private String getFromHash(Hashtable hashtable, String string) {
		Enumeration enumeration = hashtable.keys();
		while (enumeration.hasMoreElements()) {
			String string_48_ = (String) enumeration.nextElement();
			do {
				String string_49_;
				try {
					if (string_48_.equals("chat") || !string.equals((String) hashtable.get(string_48_)))
						break;
					string_49_ = string_48_;
				} catch (Exception exception) {
					break;
				}
				return string_49_;
			} while (false);
		}
		return null;
	}

	private boolean dumpFile(String string, OutputStream outputstream) {
		byte[] is = new byte[4096];
		boolean bool = true;
		try {
			FileInputStream fileinputstream = new FileInputStream(string);
			int i;
			while ((i = fileinputstream.read(is)) != -1)
				outputstream.write(is, 0, i);
			fileinputstream.close();
		} catch (Exception exception) {
			bool = false;
		}
		return bool;
	}

	private String getContentType(String string) {
		if (string == null)
			return "text/html";
		int i;
		if ((i = string.lastIndexOf(".")) <= 0)
			return "text/html";
		if (i == string.length() - 1)
			return "text/html";
		String string_50_ = string.substring(i + 1).toUpperCase();
		if (string_50_.equals("GIF"))
			return "image/gif";
		if (string_50_.equals("PNG"))
			return "image/png";
		if (string_50_.equals("TIF") || string_50_.equals("TIFF"))
			return "image/tiff";
		if (string_50_.equals("JPG") || string_50_.equals("JPEG") || string_50_.equals("JPE"))
			return "image/jpeg";
		if (string_50_.equals("TXT") || string_50_.equals("JAVA") || string_50_.equals("C") || string_50_.equals("CPP")
				|| string_50_.startsWith("HTM") || string_50_.equals("SHTML") || string_50_.equals("JHTML") || string_50_.equals("JSP")
				|| string_50_.equals("PHP") || string_50_.equals("BAT"))
			return "text/plain";
		if (string_50_.equals("AU") || string_50_.equals("SND"))
			return "audio/basic";
		if (string_50_.equals("AVI"))
			return "video/avi";
		if (string_50_.equals("DVI"))
			return "application/x-dvi";
		if (string_50_.equals("GZ"))
			return "application/x-gzip";
		if (string_50_.equals("PS") || string_50_.equals("EPS") || string_50_.equals("AI"))
			return "application/postscript";
		if (string_50_.equals("PDF"))
			return "application/pdf";
		if (string_50_.equals("MAN"))
			return "application/x-troff-man";
		if (string_50_.equals("MP3"))
			return "audio/mpeg";
		if (string_50_.equals("MPEG") || string_50_.equals("MPE") || string_50_.equals("MPG") || string_50_.equals("MPA"))
			return "video/mpeg";
		if (string_50_.equals("MID") || string_50_.equals("MIDI"))
			return "audio/mid";
		if (string_50_.equals("MTS"))
			return "application/metastream";
		if (string_50_.equals("MOV") || string_50_.equals("QT"))
			return "video/quicktime";
		if (string_50_.equals("PPT"))
			return "application/powerpoint";
		if (string_50_.equals("RPM"))
			return "audio/x-pn-realaudio-plugin";
		if (string_50_.equals("RTX"))
			return "text/richtext";
		if (string_50_.equals("RAM") || string_50_.startsWith("RA"))
			return "audio/x-pn-realaudio";
		if (string_50_.equals("SVF"))
			return "application/x-shockwave-flash";
		if (string_50_.equals("TEX"))
			return "application/x-tex";
		if (string_50_.equals("T") || string_50_.equals("TR") || string_50_.equals("ROFF"))
			return "application/x-troff";
		if (string_50_.equals("TCL"))
			return "application/x-tcl";
		if (string_50_.equals("WAV"))
			return "audio/wav";
		if (string_50_.equals("WRL"))
			return "x-world/x-vrml";
		if (string_50_.equals("DOC") || string_50_.equals("RTF") || string_50_.equals("DOT"))
			return "application/vnd.ms-word";
		if (string_50_.equals("XLS") || string_50_.equals("XLM") || string_50_.equals("XLT"))
			return "application/vnd.ms-excel";
		if (string_50_.equals("XML") || string_50_.equals("XSL"))
			return "text/xml";
		if (string_50_.equals("Z"))
			return "application/x-compress";
		if (string_50_.equals("ZIP"))
			return "application/zip";
		return "application/octet-stream";
	}

	private void clientPage(String string, String string_51_, String string_52_, HttpServletResponse httpservletresponse) throws IOException {
		PrintWriter printwriter = httpservletresponse.getWriter();
		String string_53_ = null;
		httpservletresponse.setContentType("text/html");
		Hashtable hashtable = (Hashtable) slides.get(string);
		if (hashtable != null)
			string_53_ = (String) hashtable.get("crt");
		printwriter.println("<html>");
		printwriter.println("<script language=\"JavaScript\">");
		if (string_53_ != null && !string_53_.equals(string_51_))
			printwriter.println("  parent.up1.document.location.href='" + string_52_ + "?" + "wrk" + "=" + "go1" + "&" + "tpc" + "="
					+ URLEncoder.encode(string) + "';");
		if (hashtable != null) {
			printwriter.println(makeDelay());
			printwriter.println("function ff() {");
			printwriter.print("location.href='" + string_52_ + "?" + "wrk" + "=" + "clnt" + "&" + "tpc" + "=" + URLEncoder.encode(string));
			if (string_53_ != null)
				printwriter.print("&crt=" + URLEncoder.encode(string_53_));
			printwriter.println("';");
			printwriter.println("window.status=''; }");
			printwriter.println("setTimeout(\"ff()\"," + (String) conf.get("timeout1") + ");");
		} else {
			printwriter.println("parent.up1.document.location.href='" + string_52_ + "?" + "wrk" + "=" + "empt4" + "&" + "tpc" + "="
					+ URLEncoder.encode(string) + "';");
			printwriter.println("location.href='" + string_52_ + "?" + "wrk" + "=" + "empt1" + "';");
		}
		printwriter.println("</script>");
		printwriter.println("<body>&nbsp;</body>");
		printwriter.println("</html>");
		printwriter.flush();
		printwriter.close();
	}

	private String makeDelay() {
		Random random = new Random();
		int i = (int) (20000.0 + 25000.0 * random.nextDouble());
		return " for (i=1; i<=" + i + "; i++) { }";
	}

	private void joinTopic(String string, String string_54_, HttpServletResponse httpservletresponse) throws IOException {
		String string_55_ = (String) conf.get("chat");
		String string_56_ = (String) conf.get("mode");
		httpservletresponse.setContentType("text/html");
		PrintWriter printwriter = httpservletresponse.getWriter();
		printwriter.println("<html>");
		printwriter.println("<head>");
		printwriter.println("<title>" + conf.get("title") + ":" + string + "</title>");
		printwriter.println("</head>");
		if (!string_55_.equals("0") || !string_56_.equals("0")) {
			printwriter.println("<frameset cols=\"" + conf.get("frame2") + "\" border=\"1\">");
			printwriter.println("<frame name=\"chatcolumn\" src=\"" + string_54_ + "?" + "wrk" + "=" + "intcht" + "&" + "tpc" + "="
					+ URLEncoder.encode(string) + "\">");
		}
		printwriter.println("<frameset rows=\"100%,*\" border=\"0\">");
		printwriter.println("<frame name=\"up1\" src=\"" + string_54_ + "?" + "wrk" + "=" + "empt2" + "&" + "tpc" + "=" + URLEncoder.encode(string)
				+ "\">");
		printwriter.println("<frame name=\"dwn1\" src=\"" + string_54_ + "?" + "wrk" + "=" + "clnt" + "&" + "tpc" + "=" + URLEncoder.encode(string)
				+ "\">");
		printwriter.println("</frameset>");
		if (!string_55_.equals("0") || !string_56_.equals("0"))
			printwriter.println("</frameset>");
		printwriter.println("</html>");
		printwriter.flush();
		printwriter.close();
	}

	private void goPage(String string, String string_57_, String string_58_, String string_59_, String string_60_,
			HttpServletResponse httpservletresponse) throws IOException {
		String string_61_ = string_57_.trim();
		String string_62_ = (String) conf.get("dir");
		String string_63_ = (String) conf.get("log");
		String string_64_ = string_60_;
		String string_65_ = null;
		PrintWriter printwriter = httpservletresponse.getWriter();
		Hashtable hashtable = (Hashtable) slides.get(string);
		httpservletresponse.setContentType("text/html");
		printwriter.println("<html>");
		if (string_61_.length() > 2) {
			if (string_63_ != null) {
				if (string_64_ == null)
					string_64_ = "-";
				else if (string_64_.equals(""))
					string_64_ = "-";
				logData(string, string_63_, string_64_, string_61_);
			}
			if (isFile(string_61_)) {
				if (hashtable != null)
					string_65_ = (String) hashtable.get(string_61_);
				if (string_65_ != null) {
					printwriter.println("<script language=\"JavaScript\">");
					string_65_ = (string_59_ + "?" + "wrk" + "=" + "hstfl1" + "&" + "fname" + "=" + string_65_.substring(string_62_.length()) + "&"
							+ "tpc" + "=" + URLEncoder.encode(string) + "&" + "fct" + "=" + getId());
					setCurrent(hashtable, string_65_);
					if (string_58_ == null)
						printwriter.println("parent.mddl.document.location.href='" + string_59_ + "?" + "wrk" + "=" + "go1" + "&" + "tpc" + "="
								+ URLEncoder.encode(string) + "';");
					else
						printwriter.println("parent.window.close();");
					printwriter.println("</script>");
				}
			} else {
				printwriter.println("<script language=\"JavaScript\">");
				string_65_ = string_61_.toUpperCase();
				if (!string_65_.startsWith("HTTP://"))
					string_61_ = "http://" + string_61_;
				if (hashtable != null)
					setCurrent(hashtable, string_61_);
				if (string_58_ == null) {
					printwriter.println("parent.mddl.document.location.href='" + string_59_ + "?" + "wrk" + "=" + "go1" + "&" + "tpc" + "="
							+ URLEncoder.encode(string) + "';");
					printwriter.println("parent.dwn.document.forms[0].fname.value='';");
					printwriter.println("parent.dwn.document.forms[0].scrptflnm01.value='';");
				} else
					printwriter.println("parent.window.close();");
				printwriter.println("</script>");
			}
		}
		printwriter.println("</html>");
		printwriter.flush();
		printwriter.close();
	}

	private boolean isFile(String string) {
		String string_66_ = string.toUpperCase();
		if (string_66_.startsWith("HTTP:"))
			return false;
		if (string_66_.startsWith("FILE:"))
			return true;
		if (string_66_.startsWith(separator))
			return true;
		char c = string_66_.charAt(1);
		if (c == ':' || c == '|')
			return true;
		return false;
	}

	private void clearCache(String string, HttpServletResponse httpservletresponse) throws IOException {
		Hashtable hashtable = (Hashtable) slides.get(string);
		if (hashtable != null)
			clearFiles(hashtable);
		upTopicFrame(httpservletresponse);
	}

	private void acceptScript(String string, String string_67_, HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
			throws IOException {
		String[] strings = uploadFile(httpservletrequest, string);
		downTopicFrame(string, string_67_, strings[1], httpservletresponse);
	}

	private void acceptScriptFile(String string, String string_68_, HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
			throws IOException {
		String string_69_ = httpservletrequest.getParameter("script");
		downTopicFrame(string, string_68_, string_69_, httpservletresponse);
	}

	private String[] uploadFile(HttpServletRequest httpservletrequest, String string) throws IOException {
		ServletInputStream servletinputstream = httpservletrequest.getInputStream();
		String string_70_ = httpservletrequest.getCharacterEncoding();
		String string_71_ = httpservletrequest.getContentType();
		String string_72_ = null;
		String string_73_ = "";
		byte[] is = new byte[4096];
		byte[] is_74_ = new byte[4096];
		int[] is_75_ = new int[1];
		int[] is_76_ = new int[1];
		String[] strings = { "", "" };
		int i;
		if ((i = string_71_.indexOf("boundary=")) != -1) {
			string_71_ = string_71_.substring(i + 9);
			string_71_ = "--" + string_71_;
		}
		String string_77_;
		while_0_: do {
			do {
				if ((string_77_ = readLine(is, is_75_, servletinputstream, string_70_)) == null)
					break while_0_;
				i = string_77_.indexOf("filename=");
			} while (i < 0);
			string_77_ = string_77_.substring(i + 10);
			i = string_77_.indexOf("\"");
			if (i > 0)
				string_77_ = string_77_.substring(0, i);
		} while (false);
		string_73_ = string_77_;
		strings[0] = string_73_;
		Hashtable hashtable = (Hashtable) slides.get(string);
		string_77_ = (String) hashtable.get(string_73_);
		if (string_77_ != null) {
			strings[1] = string_77_;
			return strings;
		}
		String string_78_ = (String) conf.get("dir");
		String string_79_ = getId();
		string_77_ = readLine(is, is_75_, servletinputstream, string_70_);
		if (string_77_.indexOf("Content-Type") >= 0)
			readLine(is, is_75_, servletinputstream, string_70_);
		File file = new File(string_78_, string_79_);
		FileOutputStream fileoutputstream = new FileOutputStream(file);
		while ((string_77_ = readLine(is, is_75_, servletinputstream, string_70_)) != null && (string_77_.indexOf(string_71_) != 0 || is[0] != 45)) {
			if (string_72_ != null) {
				fileoutputstream.write(is_74_, 0, is_76_[0]);
				fileoutputstream.flush();
			}
			string_72_ = readLine(is_74_, is_76_, servletinputstream, string_70_);
			if (string_72_ == null || string_72_.indexOf(string_71_) == 0 && is_74_[0] == 45)
				break;
			fileoutputstream.write(is, 0, is_75_[0]);
			fileoutputstream.flush();
		}
		if (NEWLINE.length() == 1)
			i = 2;
		else
			i = 1;
		if (string_72_ != null && is_74_[0] != 45 && is_76_[0] > NEWLINE.length() * i)
			fileoutputstream.write(is_74_, 0, is_76_[0] - NEWLINE.length() * i);
		if (string_77_ != null && is[0] != 45 && is_75_[0] > NEWLINE.length() * i)
			fileoutputstream.write(is, 0, is_75_[0] - NEWLINE.length() * i);
		fileoutputstream.close();
		hashtable.put(string_73_, string_78_ + string_79_);
		strings[1] = string_78_ + string_79_;
		return strings;
	}

	private String readLine(byte[] paramArrayOfByte, int[] paramArrayOfInt, ServletInputStream paramServletInputStream, String paramString) {
		try {
			paramArrayOfInt[0] = paramServletInputStream.readLine(paramArrayOfByte, 0, paramArrayOfByte.length);
			if (paramArrayOfInt[0] == -1)
				return null;
		} catch (IOException localIOException) {
			return null;
		}
		try {
			if (paramString == null)
				return new String(paramArrayOfByte, 0, paramArrayOfInt[0]);
			return new String(paramArrayOfByte, 0, paramArrayOfInt[0], paramString);
		} catch (Exception localException) {
		}
		return null;
	}

	private void upTopicFrame(HttpServletResponse httpservletresponse) throws IOException {
		PrintWriter printwriter = httpservletresponse.getWriter();
		httpservletresponse.setContentType("text/html");
		printwriter.println("<html>&nbsp;</html>");
		printwriter.flush();
		printwriter.close();
	}

	private void middleTopicFrame(String string, String string_87_, HttpServletResponse httpservletresponse) throws IOException {
		String string_88_ = null;
		PrintWriter printwriter = httpservletresponse.getWriter();
		Hashtable hashtable = (Hashtable) slides.get(string_87_);
		if (hashtable != null)
			string_88_ = (String) hashtable.get("crt");
		httpservletresponse.setContentType("text/html");
		printwriter.println("<html>");
		printwriter.println("<head>");
		printwriter.println("<title>" + conf.get("title") + ":" + string_87_ + "</title>");
		printwriter.println("</head>");
		printwriter.println("<body bgcolor=\"" + conf.get("bgcolor") + "\">");
		String string_89_ = getFont(conf);
		printwriter.println(string_89_);
		if (string_88_ != null) {
			printwriter.println("<script language=\"JavaScript\">");
			printwriter.println(" location.href='" + string + "?" + "wrk" + "=" + "go1" + "&" + "tpc" + "=" + URLEncoder.encode(string_87_) + "';");
			printwriter.println("</script>");
		} else {
			String string_90_;
			if ((string_90_ = (String) conf.get("header")) != null)
				printwriter.println(getBanner(string_90_));
			printwriter.println("<br><p><center><h1>" + conf.get("title") + "</h1></center>");
			printwriter.print("<br>Topic:" + string_87_);
			if (hashtable == null) {
				printwriter.println(" is closed.<br>");
				printwriter.println("<a href=\"" + string + "\" target=_top>Main page</a><br>");
			} else
				printwriter.println("");
		}
		printwriter.println("<br><br>&nbsp;&copy;&nbsp;");
		printwriter.println("</font></body>");
		printwriter.println("</html>");
		printwriter.flush();
		printwriter.close();
	}

	private void downTopicFrame(String string, String string_91_, String string_92_, HttpServletResponse httpservletresponse) throws IOException {
		PrintWriter printwriter = httpservletresponse.getWriter();
		Hashtable hashtable = (Hashtable) slides.get(string);
		String string_93_ = (String) conf.get("chat");
		String string_94_ = (String) conf.get("script");
		String string_95_ = (String) conf.get("fastclick");
		String string_96_ = (String) conf.get("pages");
		String string_97_ = (String) conf.get("logout");
		httpservletresponse.setContentType("text/html");
		printwriter.println("<html>");
		printwriter.println("<body bgcolor=\"" + conf.get("bgcolor") + "\">");
		String string_98_ = getFont(conf);
		printwriter.println(string_98_);
		printwriter.println("<script language=\"JavaScript\">");
		printwriter.println("function fun(wt)");
		printwriter.println("{");
		printwriter.println("document.forms[0].wrk.value=wt;");
		printwriter.println("document.forms[0].submit();");
		printwriter.println("}");
		printwriter.println("function fun1()");
		printwriter.println("{");
		printwriter.println("document.forms[0].fname.value=document.forms[3].sld.options[document.forms[3].sld.selectedIndex].value;");
		printwriter.println("document.forms[0].scrptflnm01.value=document.forms[3].scrptflnm01.value;");
		if (string_95_.equals("1")) {
			printwriter.println("document.forms[0].wrk.value='go';");
			printwriter.println("document.forms[0].submit();");
		}
		printwriter.println("}");
		printwriter.println("function fun1Pages()");
		printwriter.println("{");
		printwriter.println("document.forms[0].fname.value=document.forms[3].crp.value;");
		printwriter.println("document.forms[0].scrptflnm01.value=document.forms[3].scrptflnm01.value;");
		if (string_95_.equals("1")) {
			printwriter.println("document.forms[0].wrk.value='go';");
			printwriter.println("document.forms[0].submit();");
		}
		printwriter.println("}");
		if (!string_93_.equals("0"))
			printwriter.println(mainChatScript("chat", ((String) conf.get("chatwindow1")), string_91_, string, string_93_));
		printwriter.println("</script>");
		printwriter.println("<table width=\"100%\" border=\"0\">");
		printwriter.println("<tr>");
		printwriter.println("<form method=\"post\" action=\"" + string_91_ + "\" target=\"" + "up" + "\">");
		printwriter.println("<td nowrap>" + string_98_);
		printwriter.println("<input type=\"hidden\" name=\"wrk\" value=\"go\">");
		printwriter.println("<input type=\"hidden\" name=\"tpc1\" value=\"" + string + "\">");
		printwriter.println("<input type=\"hidden\" name=\"scrptflnm01\" value=\"\">\n");
		printwriter.print(getLabel(conf, "Url") + ":&nbsp;<input type=\"text\" name=\"" + "fname" + "\" size=\"50\"");
		String string_99_;
		if (hashtable != null && (string_99_ = (String) hashtable.get("crt")) != null && string_99_.indexOf("fname=") < 0)
			printwriter.print(" value=\"" + string_99_ + "\"");
		printwriter.println(">");
		printwriter.println("&nbsp;<input type=\"button\" value=\"" + getLabel(conf, "Go") + "\" onClick=\"fun('" + "go" + "');\"></font></td>");
		printwriter.println("<td nowrap align=\"right\">" + string_98_ + "<input type=\"button\" value=\"" + getLabel(conf, "Clear")
				+ "\" onClick=\"fun('" + "clr" + "');\"></font></td>");
		printwriter.println("</form></tr></table>");
		printwriter.println("<table width=\"100%\" border=\"0\">");
		printwriter.println("<tr>");
		printwriter.println("<td nowrap align=\"right\">" + string_98_ + getLabel(conf, "File") + ":</font></td>");
		printwriter.println("<form method=\"post\" enctype=\"multipart/form-data\" action=\"" + string_91_ + "?" + "wrk" + "=" + "hstfl" + "&"
				+ "tpc" + "=" + URLEncoder.encode(string) + "\" target=\"" + "up" + "\">");
		printwriter.print("<td nowrap>" + string_98_ + "<input type=\"file\" name=\"" + "fname" + "\">&nbsp;&nbsp;");
		printwriter.println("<input type=submit value=\"" + getLabel(conf, "Read file") + "\" title=\"Read/share local file\"></font></td>");
		printwriter.println("</form>");
		printwriter.println("<form method=\"post\" action=\"" + string_91_ + "\" target=\"_top\">");
		if (string_97_.equals("1"))
			printwriter.println("<input type=\"hidden\" name=\"wrk\" value=\"logout\">");
		else
			printwriter.println("<input type=\"hidden\" name=\"wrk\" value=\"does not exist\">");
		printwriter.println("<input type=\"hidden\" name=\"tpc1\" value=\"" + string + "\">");
		printwriter.print("<td nowrap align=\"right\">" + string_98_);
		if (!string_93_.equals("0"))
			printwriter.print("<input type=\"button\" value=\"" + getLabel(conf, "Chat") + "\" onClick=\"openchat();\">&nbsp;&nbsp;");
		printwriter.print("<input type=\"submit\" value=\"" + getLabel(conf, "Logout") + "\">");
		printwriter.println("</font></td>");
		printwriter.println("</form>");
		printwriter.println("</tr>");
		printwriter.println("<tr>");
		if (string_94_ == null)
			printwriter.println("<form name=\"scriptForm\" method=\"post\" enctype=\"multipart/form-data\" action=\"" + string_91_ + "?" + "wrk"
					+ "=" + "scrpt" + "&" + "tpc" + "=" + URLEncoder.encode(string) + "\">");
		else
			printwriter.println("<form name=\"scriptForm\" method=\"post\" action=\"" + string_91_ + "?" + "wrk" + "=" + "script" + "&" + "tpc" + "="
					+ URLEncoder.encode(string) + "\">");
		printwriter.println("<td nowrap align=\"right\">" + string_98_ + getLabel(conf, "Script") + ":</font></td>");
		if (string_94_ == null) {
			printwriter.print("<td nowrap>" + string_98_ + "<input type=\"file\" name=\"" + "fname" + "\">&nbsp;&nbsp;");
			printwriter.println("<input type=\"submit\" value=\"" + getLabel(conf, "Read script") + "\" title=\"Read script file\"></font></td>");
		} else {
			printwriter.print("<td nowrap>" + string_98_);
			File file = new File(string_94_);
			if (file == null)
				printwriter.print("could not get script file " + string_94_);
			else if (!file.canRead())
				printwriter.print("could not read script file " + string_94_);
			else {
				if (file.isFile()) {
					printwriter.println("<select name=\"script\">");
					printwriter.println("<option value=\"" + string_94_.replace('\\', '/') + "\">" + file.getName() + "</option>");
					printwriter.println("</select>");
					printwriter.println("<input type=\"submit\" value=\"" + getLabel(conf, "Read script") + "\" title=\"Read script file\">");
				} else if (file.isDirectory()) {
					String[] strings = file.list();
					printwriter.println("<select name=\"script\">");
					for (int i = 0; i < strings.length; i++) {
						if (strings[i].endsWith(".txt")) {
							file = new File(string_94_, strings[i]);
							printwriter.println("<option value=\"" + file.getAbsolutePath().replace('\\', '/') + "\">" + strings[i] + "</option>");
						}
					}
					printwriter.println("</select>");
					printwriter.println("<input type=\"submit\" value=\"" + getLabel(conf, "Read script") + "\" title=\"Read script file\">");
				} else
					printwriter.print("could not read script file " + string_94_);
				printwriter.print("</font></td>");
			}
		}
		printwriter.println("<td nowrap align=\"right\">" + string_98_);
		if (string_92_ != null) {
			if (string_96_.equals("0")) {
				printwriter.println("<select name=\"sld\" onChange=\"fun1();\">");
				printwriter.println(readScript(string_92_));
				printwriter.println("</select>");
			} else
				printwriter.println(readScript1(string_92_, string_95_));
			printwriter.println("<input type=\"hidden\" name=\"scrptflnm01\" value=\"" + string_92_ + "\">\n");
		} else
			printwriter.print("&nbsp;");
		printwriter.println("</font></td></form></tr></table>");
		printwriter.println("<br>&nbsp;&copy;&nbsp;&nbsp;&nbsp");
		printwriter.println("</font></body></html>");
		printwriter.flush();
		printwriter.close();
	}

	private void deleteTopic(String string, HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse) throws IOException {
		Enumeration enumeration = httpservletrequest.getParameterNames();
		while (enumeration.hasMoreElements()) {
			String string_100_ = (String) enumeration.nextElement();
			if (string_100_.charAt(0) == '_') {
				string_100_ = string_100_.substring(1);
				Hashtable hashtable = (Hashtable) slides.get(string_100_);
				if (hashtable != null) {
					slides.remove(string_100_);
					clearFiles(hashtable);
				}
			}
		}
		adminPage((String) conf.get("admin"), string, httpservletrequest, httpservletresponse);
	}

	private String readScript(String string) {
		StringBuffer stringbuffer = new StringBuffer("");
		int i = 0;
		try {
			BufferedReader bufferedreader = (new BufferedReader(new InputStreamReader(new FileInputStream(string))));
			String string_101_;
			while ((string_101_ = bufferedreader.readLine()) != null) {
				string_101_ = string_101_.trim();
				if (string_101_.length() > 0 && !string_101_.startsWith("//") && string_101_.charAt(0) != '#' && i <= 5) {
					i++;
					int i_102_;
					if ((i_102_ = string_101_.indexOf("\t")) < 0)
						i_102_ = string_101_.indexOf(" ");
					if (i_102_ > 0 && i_102_ < string_101_.length() - 1) {
						String string_103_ = string_101_.substring(0, i_102_).trim();
						String string_104_ = string_101_.substring(i_102_ + 1).trim();
						stringbuffer.append("<option name=\"");
						stringbuffer.append(string_104_);
						stringbuffer.append("\" value=\"");
						stringbuffer.append(string_103_);
						stringbuffer.append("\">");
						stringbuffer.append(string_104_);
						stringbuffer.append("</option>\n");
					}
				}
			}
			bufferedreader.close();
		} catch (Exception exception) {
			/* empty */
		}
		String string_105_ = stringbuffer.toString();
		if (string_105_.length() > 0)
			string_105_ = ("<option name=\"Coldbeans\" value=\"\">Please, select </option>" + string_105_);
		return string_105_;
	}

	private String readScript1(String string, String string_106_) {
		int i = 0;
		Vector vector = new Vector();
		try {
			BufferedReader bufferedreader = (new BufferedReader(new InputStreamReader(new FileInputStream(string))));
			String string_107_;
			while ((string_107_ = bufferedreader.readLine()) != null) {
				string_107_ = string_107_.trim();
				if (string_107_.length() > 0 && !string_107_.startsWith("//") && string_107_.charAt(0) != '#' && i <= 5) {
					i++;
					int i_108_;
					if ((i_108_ = string_107_.indexOf("\t")) < 0)
						i_108_ = string_107_.indexOf(" ");
					if (i_108_ > 0 && i_108_ < string_107_.length() - 1) {
						String string_109_ = string_107_.substring(0, i_108_).trim();
						String string_110_ = string_107_.substring(i_108_ + 1).trim();
						vector.add(string_110_);
						vector.add(string_109_);
					}
				}
			}
			bufferedreader.close();
		} catch (Exception exception) {
			/* empty */
		}
		if (vector.size() == 0)
			return "";
		StringBuffer stringbuffer = new StringBuffer("\n");
		stringbuffer.append("<script language=\"JavaScript\">\n");
		stringbuffer.append("var Titles=new Array();\n");
		stringbuffer.append("var current=0;\n");
		for (i = 0; i < vector.size(); i++) {
			stringbuffer.append("Titles[current]='" + vector.elementAt(i) + "';\n");
			stringbuffer.append("current++;\n");
		}
		stringbuffer.append("current=0;\n");
		stringbuffer.append("function prevSlide()\n");
		stringbuffer.append("{\n");
		stringbuffer.append("current-=2;\n");
		stringbuffer.append("if (current<0) current=0;\n");
		stringbuffer.append("document.forms['scriptForm'].crs.value=Titles[current];\n");
		stringbuffer.append("document.forms['scriptForm'].crp.value=Titles[current+1];\n");
		if (string_106_.equals("1"))
			stringbuffer.append("fun1Pages();\n");
		stringbuffer.append("}\n");
		stringbuffer.append("function setThisSlide()\n");
		stringbuffer.append("{\n");
		stringbuffer.append("fun1Pages();\n");
		stringbuffer.append("}\n");
		stringbuffer.append("function nextSlide()\n");
		stringbuffer.append("{\n");
		stringbuffer.append("current+=2;\n");
		stringbuffer.append("if (current>=Titles.length) current=Titles.length-2;\n");
		stringbuffer.append("document.forms['scriptForm'].crs.value=Titles[current];\n");
		stringbuffer.append("document.forms['scriptForm'].crp.value=Titles[current+1];\n");
		if (string_106_.equals("1"))
			stringbuffer.append("fun1Pages();\n");
		stringbuffer.append("}\n");
		stringbuffer.append("</script>\n");
		stringbuffer.append("<a style=\"text-decoration:none\" href=\"javascript:prevSlide();\">&lt;&lt;</a>");
		stringbuffer.append("&nbsp;\n");
		stringbuffer.append("<input type=\"text\" name=\"crs\" value=");
		stringbuffer.append("\"" + vector.elementAt(0) + "\"");
		stringbuffer.append(" style=\"");
		stringbuffer
				.append("text-align:center;cursor:hand;BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none;");
		stringbuffer.append(" onFocus=\"blur();\" onClick=\"setThisSlide();blur();\">");
		stringbuffer.append("<input type=\"hidden\" name=\"crp\" value=");
		stringbuffer.append("\"" + vector.elementAt(1) + "\">");
		stringbuffer.append("&nbsp;\n");
		stringbuffer.append("<a style=\"text-decoration:none\" href=\"javascript:nextSlide();\">&gt;&gt;</a>");
		return stringbuffer.toString();
	}

	private void setCurrent(Hashtable hashtable, String string) {
		String string_111_ = (String) hashtable.get("crt");
		if (string_111_ != null)
			hashtable.put("prev", string_111_);
		hashtable.put("crt", string);
	}

	private void clearFiles(Hashtable hashtable) {
		Enumeration enumeration = hashtable.keys();
		String string = (String) conf.get("dir");
		while (enumeration.hasMoreElements()) {
			String string_112_ = (String) enumeration.nextElement();
			if (!string_112_.equals("pass") && !string_112_.equals("crt") && !string_112_.equals("chat")) {
				try {
					File file = new File((String) hashtable.get(string_112_));
					file.delete();
				} catch (Exception exception) {
					/* empty */
				}
				hashtable.remove(string_112_);
			}
		}
	}

	private void newTopicPage(String string, String string_113_, String string_114_, HttpServletRequest httpservletrequest,
			HttpServletResponse httpservletresponse) throws IOException {
		if (slides.get(string) != null)
			loginPage(string_114_, httpservletrequest, httpservletresponse);
		else {
			Hashtable hashtable = new Hashtable();
			hashtable.put("pass", string_113_);
			if (!((String) conf.get("chat")).equals("0"))
				hashtable.put("chat", new Vector());
			slides.put(string, hashtable);
			topicPage(string, string_114_, httpservletrequest, httpservletresponse);
		}
	}

	private void topicPage(String string, String string_115_, HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
			throws IOException {
		PrintWriter printwriter = httpservletresponse.getWriter();
		httpservletresponse.setContentType("text/html");
		printwriter.println("<html>");
		printwriter.println("<head>");
		printwriter.println("<title>" + conf.get("title") + ":" + string + "</title>");
		printwriter.println("</head>");
		printwriter.println("<frameset rows=\"*," + conf.get("frame1") + "\" border=\"0\">");
		printwriter.println("<frame name=\"up\" src=\"" + string_115_ + "?" + "wrk" + "=" + "empt1" + "\">");
		printwriter.println("<frame name=\"mddl\" src=\"" + string_115_ + "?" + "wrk" + "=" + "empt2" + "&" + "tpc" + "=" + URLEncoder.encode(string)
				+ "\">");
		printwriter.println("<frame name=\"dwn\" src=\"" + string_115_ + "?" + "wrk" + "=" + "empt3" + "&" + "tpc" + "=" + URLEncoder.encode(string)
				+ "\">");
		printwriter.println("</frameset>");
		printwriter.println("</html>");
		printwriter.flush();
		printwriter.close();
	}

	private void adminPage(String string, String string_116_, HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
			throws IOException {
		String string_117_ = (String) conf.get("admin");
		if (string_117_.equals(string)) {
			PrintWriter printwriter = httpservletresponse.getWriter();
			httpservletresponse.setContentType("text/html");
			printwriter.println("<html>");
			printwriter.println("<head>");
			printwriter.println("<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">");
			printwriter.println("<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"300;URL=" + string_116_ + "\">");
			printwriter.println("<title>" + conf.get("title") + "</title>");
			printwriter.println("</head>");
			printwriter.println("<body bgcolor=\"" + conf.get("bgcolor") + "\">");
			String string_118_ = getFont(conf);
			printwriter.println(string_118_);
			if ((string_117_ = (String) conf.get("header")) != null)
				printwriter.println(getBanner(string_117_));
			printwriter.println("<center><h1>Admin page:" + conf.get("title") + "</h1></center>");
			printwriter.println("<br><table width=\"100%\" border=\"0\">");
			printwriter.println("<form method=\"post\" action=\"" + string_116_ + "\">");
			printwriter.println("<input type=hidden name=\"wrk\" value=\"dlt\">");
			Enumeration enumeration = slides.keys();
			while (enumeration.hasMoreElements()) {
				string_117_ = (String) enumeration.nextElement();
				printwriter.println("<tr><td nowrap width=\"10%\">" + string_118_ + "<input type=\"checkbox\" name=\"_" + string_117_ + "\" value=\""
						+ string_117_ + "\"></font></td><td nowrap>" + string_118_ + string_117_ + "</font></td></tr>");
			}
			printwriter.print("<tr><td nowrap>" + string_118_ + "&nbsp;</font></td><td nowrap>" + string_118_);
			if (slides.size() > 0)
				printwriter.print("<input type=submit value=\"Delete\">");
			printwriter.println("&nbsp;&nbsp;<input type=button value=\"Main page\" onClick=\"javascript:location.href='" + string_116_
					+ "';\"></font></td></tr>");
			printwriter.println("</form></table>");
			printwriter.println("<br><br>&nbsp;&copy;&nbsp;&nbsp;&nbsp;");
			printwriter.println("</font></body>");
			printwriter.println("</html>");
			printwriter.flush();
			printwriter.close();
		} else
			loginPage(string_116_, httpservletrequest, httpservletresponse);
	}

	private void loginPage(String string, HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse) throws IOException {
		PrintWriter printwriter = httpservletresponse.getWriter();
		httpservletresponse.setContentType("text/html");
		printwriter.println("<html>");
		printwriter.println("<head>");
		printwriter.println("<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">");
		printwriter.println("<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"600;URL=" + string + "\">");
		printwriter.println("<title>" + conf.get("title") + "</title>");
		printwriter.println("</head>");
		printwriter.println("<body bgcolor=\"" + conf.get("bgcolor") + "\">");
		if (slides.size() > 0) {
			printwriter.println("<script language=\"JavaScript\">");
			printwriter.println(" function fun(what)");
			printwriter.println(" { document.rntr.wrk.value=what; document.rntr.submit(); }");
			printwriter.println("</script>");
		}
		String string_119_ = getFont(conf);
		printwriter.println(string_119_);
		String string_120_;
		if ((string_120_ = (String) conf.get("header")) != null)
			printwriter.println(getBanner(string_120_));
		printwriter.println("<center><h1>" + conf.get("title") + "</h1></center>");
		printwriter.println("<br>&nbsp;<b><u>Options</u></b><br>");
		printwriter.println("<br><i><u>1) Admin</u></i><br>");
		printwriter.println("<br><table border=\"0\">");
		printwriter.println("<form method=\"post\" action=\"" + string + "\">");
		printwriter.println("<input type=\"hidden\" name=\"wrk\" value=\"admin\">");
		printwriter
				.print("<tr><td nowrap>" + string_119_ + "&nbsp;Password:&nbsp;" + "<input type=\"password\" name=\"" + "pass" + "\"></font></td>");
		printwriter.println("<td nowrap>" + string_119_ + "&nbsp;&nbsp;<input type=\"submit\" value=\"Enter\"></font></td></tr>");
		printwriter.println("</form>");
		printwriter.println("</table>");
		if (slides.size() > 0) {
			printwriter.println("<br><i><u>2) Join existing</u></i><br>");
			printwriter.println("<br><table border=\"0\">");
			printwriter.println("<form method=\"post\" action=\"" + string + "\">");
			printwriter.println("<input type=\"hidden\" name=\"wrk\" value=\"jn\">");
			printwriter.println("<td nowrap>" + string_119_ + "Topic:&nbsp;");
			printwriter.println("<select name=\"tpc\">");
			Enumeration enumeration = slides.keys();
			while (enumeration.hasMoreElements()) {
				string_120_ = (String) enumeration.nextElement();
				printwriter.println("<option value=\"" + string_120_ + "\">" + string_120_ + "</option>");
			}
			printwriter.println("</select></font></td>");
			printwriter.println("<td nowrap>" + string_119_ + "&nbsp;&nbsp;<input type=submit value=\"Join\"></font></td></tr>");
			printwriter.println("</form>");
			printwriter.println("</table>");
		}
		printwriter.println("<br><i><u>3) Create new</u></i><br>");
		printwriter.println("<br><table border=\"0\">");
		printwriter.println("<form method=\"post\" action=\"" + string + "\">");
		printwriter.println("<input type=\"hidden\" name=\"wrk\" value=\"create\">");
		printwriter.print("<tr><td nowrap>" + string_119_ + "&nbsp;Topic:&nbsp;" + "<input type=text name=\"" + "tpc1" + "\"></font></td>");
		printwriter.print("<td nowrap align=\"right\">" + string_119_ + "&nbsp;Password:&nbsp;" + "<input type=\"password\" name=\"" + "pass"
				+ "\"></font></td><td nowrap>" + string_119_ + "&nbsp;</font></td>");
		printwriter.print("<tr><td nowrap>" + string_119_ + "&nbsp;</font></td><td nowrap align=right>" + string_119_ + "&nbsp;Retype:&nbsp;"
				+ "<input type=\"password\" name=\"" + "pass1" + "\"></font></td>");
		printwriter.println("<td nowrap>" + string_119_ + "&nbsp;&nbsp;<input type=submit value=\"Create\"></font></td></tr>");
		printwriter.println("</form>");
		printwriter.println("</table>");
		if (slides.size() > 0) {
			printwriter.println("<br><i><u>4) Re-enter or close existing</u></i><br>");
			printwriter.println("<br><table border=\"0\">");
			printwriter.println("<form name=\"rntr\" method=\"post\" action=\"" + string + "\">");
			printwriter.println("<input type=\"hidden\" name=\"wrk\" value=\"rntr\">");
			printwriter.println("<tr><td nowrap>" + string_119_ + "Topic:&nbsp;");
			printwriter.println("<select name=\"tpc\">");
			Enumeration enumeration = slides.keys();
			while (enumeration.hasMoreElements()) {
				string_120_ = (String) enumeration.nextElement();
				printwriter.println("<option value=\"" + string_120_ + "\">" + string_120_ + "</option>");
			}
			printwriter.println("</select></font></td>");
			printwriter.println("<td nowrap>" + string_119_ + "&nbsp;Password:&nbsp;" + "<input type=\"password\" name=\"" + "pass"
					+ "\"></font></td>");
			printwriter.print("<td nowrap>" + string_119_
					+ "&nbsp;&nbsp;<input type=\"button\" value=\"Re-enter\" title=\"Open topic\" onClick=\"fun('" + "rntr" + "');\">");
			printwriter
					.println("&nbsp;&nbsp;<input type=\"button\" value=\"Close\" title=\"Delete topic\" onClick=\"fun('close');\"></font></td></tr>");
			printwriter.println("</form>");
			printwriter.println("</table>");
		}
		printwriter.println("<br><br>&nbsp;&copy;&nbsp;&nbsp;&nbsp;");
		printwriter.println("</font></body>");
		printwriter.println("</html>");
		printwriter.flush();
		printwriter.close();
	}

	private String decode(String string) {
		StringBuffer stringbuffer = new StringBuffer(0);
		for (int i = 0; i < string.length(); i++) {
			char c = string.charAt(i);
			if (c == '+')
				stringbuffer.append(' ');
			else if (c == '%') {
				char c_121_ = '\0';
				for (int i_122_ = 0; i_122_ < 2; i_122_++) {
					c_121_ *= '\020';
					c = string.charAt(++i);
					if (c >= '0' && c <= '9')
						c_121_ += c - '0';
					else {
						if ((c < 'A' || c > 'F') && (c < 'a' || c > 'f'))
							break;
						switch (c) {
						case 'A':
						case 'a':
							c_121_ += '\n';
							break;
						case 'B':
						case 'b':
							c_121_ += '\013';
							break;
						case 'C':
						case 'c':
							c_121_ += '\014';
							break;
						case 'D':
						case 'd':
							c_121_ += '\r';
							break;
						case 'E':
						case 'e':
							c_121_ += '\016';
							break;
						case 'F':
						case 'f':
							c_121_ += '\017';
							break;
						}
					}
				}
				stringbuffer.append(c_121_);
			} else
				stringbuffer.append(c);
		}
		return stringbuffer.toString();
	}

	private String getFont(Hashtable hashtable) {
		String string = "<font color=\"" + hashtable.get("forecolor") + "\"";
		String string_123_;
		if ((string_123_ = (String) hashtable.get("size")) != null)
			string += " size=\"" + (String) string_123_ + "\"";
		if ((string_123_ = (String) hashtable.get("face")) != null)
			string += " face=\"" + (String) string_123_ + "\"";
		return string + ">";
	}

	private String getBanner(String string) {
		StringBuffer stringbuffer = new StringBuffer("");
		try {
			BufferedReader bufferedreader = (new BufferedReader(new InputStreamReader(new FileInputStream(string))));
			String string_124_;
			while ((string_124_ = bufferedreader.readLine()) != null)
				stringbuffer.append(string_124_ + NEWLINE);
			bufferedreader.close();
			stringbuffer.append("<br>\n");
		} catch (Exception exception) {
			/* empty */
		}
		return stringbuffer.toString();
	}

	private String mainChatScript(String string, String string_125_, String string_126_, String string_127_, String string_128_) {
		StringBuffer stringbuffer = new StringBuffer("");
		stringbuffer.append("var chatwnd=null;\n");
		stringbuffer.append("function openchat()\n");
		stringbuffer.append("{\n");
		stringbuffer.append(" op=false;\n");
		stringbuffer.append(" if (chatwnd==null) op=true;\n");
		stringbuffer.append(" else\n");
		stringbuffer.append("   if (chatwnd.closed) op=true;\n");
		stringbuffer.append(" if (op)\n");
		stringbuffer.append("  chatwnd=window.open('" + string_126_ + "?" + "wrk" + "=" + string + "&" + "tpc" + "=" + URLEncoder.encode(string_127_)
				+ "','" + string + "','" + string_125_ + "');\n");
		stringbuffer.append("}\n");
		return stringbuffer.toString();
	}

	private String mainSuggestScript(String string, String string_129_, String string_130_) {
		StringBuffer stringbuffer = new StringBuffer("");
		stringbuffer.append("var suggestwnd=null;\n");
		stringbuffer.append("function suggest()\n");
		stringbuffer.append("{\n");
		stringbuffer.append(" op1=false;\n");
		stringbuffer.append(" if (suggestwnd==null) op1=true;\n");
		stringbuffer.append(" else\n");
		stringbuffer.append("   if (suggestwnd.closed) op1=true;\n");
		stringbuffer.append(" if (op1)\n");
		stringbuffer.append("  suggestwnd=window.open('" + string_129_ + "?" + "wrk" + "=" + string + "&" + "tpc" + "="
				+ URLEncoder.encode(string_130_) + "','" + string + "','"
				+ "width=500,height=200,location=no,toolbar=no,menubar=no,scrollbars=yes,resize=yes,top=30,left=30');\n");
		stringbuffer.append("}\n");
		return stringbuffer.toString();
	}

	private void errorMessage(String string, PrintWriter printwriter) {
		printwriter.println("<html>");
		printwriter.println(string);
		printwriter.println("</html>");
		printwriter.flush();
		printwriter.close();
	}

	private String getId() {
		String str = "";
		synchronized (SessionIdLock) {
			long l = System.currentTimeMillis();
			Random localRandom = new Random();
			str = String.valueOf(l);
			for (int i = 1; i <= 6; ++i)
				str = str + (int) (1.0D + 6.0D * localRandom.nextDouble());
		}
		return str;
	}

	private String getFromQuery(String string, String string_131_) {
		if (string == null)
			return "";
		int i;
		if ((i = string.indexOf(string_131_)) < 0)
			return "";
		String string_132_ = string.substring(i + string_131_.length());
		if ((i = string_132_.indexOf("&")) < 0)
			return decode(string_132_);
		return decode(string_132_.substring(0, i));
	}

	public String getServletInfo() {
		return "A servlet that supports slides ver. 3.0";
	}

	private String composeMessage(Vector vector) {
		Date date = (Date) vector.elementAt(1);
		String string = date.toString();
		String string_133_ = (String) vector.elementAt(2);
		int i = string.indexOf(":");
		if (string_133_.equals("Owner"))
			string_133_ = ("<font color=\"" + (String) conf.get("forecolor1") + "\">" + string_133_ + "</font>");
		return (string.substring(i - 2, i) + string.substring(i, i + 3) + "&nbsp;" + string_133_ + "&nbsp;:&nbsp;" + (String) vector.elementAt(4));
	}

	private String decodeString(String paramString1, String paramString2, String paramString3) {
		String str;
		try {
			str = new String(paramString1.getBytes((paramString2 == null) ? "ISO-8859-1" : paramString2), paramString3);
		} catch (Exception localException) {
			str = paramString1;
		}
		return str;
	}

	private String prepareMsg(String paramString) {
		String str = paramString.trim();
		StringBuffer localStringBuffer = new StringBuffer("");
		for (int i = 0; i < str.length(); ++i) {
			char c = str.charAt(i);
			if (c == '<')
				localStringBuffer.append("&lt;");
			else if (c == '>')
				localStringBuffer.append("&gt;");
			else if (c == '"')
				localStringBuffer.append("&quot;");
			else if (c == '&')
				localStringBuffer.append("&amp;");
			else
				localStringBuffer.append(c);
		}
		return localStringBuffer.toString();
	}

	private boolean readConfig(String paramString, Hashtable paramHashtable) {
		String str;

		boolean bool = true;
		paramHashtable.put("config", paramString);
		try {
			BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(paramString)));
			while ((str = localBufferedReader.readLine()) != null) {
				str = str.trim();
				if (str.length() <= 0)
					continue;
				int i = str.indexOf("=");
				if ((i <= 0) || (i >= str.length() - 1) || (str.charAt(0) == '#') || (str.startsWith("//")))
					continue;
				paramHashtable.put(str.substring(0, i).trim(), str.substring(i + 1).trim());
			}
			localBufferedReader.close();
		} catch (Exception localException1) {
			bool = false;
		}
		if (paramHashtable.get("bgcolor") == null)
			paramHashtable.put("bgcolor", "#FFFFFF");
		if (paramHashtable.get("forecolor") == null)
			paramHashtable.put("forecolor", "#000000");
		if (paramHashtable.get("forecolor1") == null)
			paramHashtable.put("forecolor1", "#FF0000");
		if (paramHashtable.get("title") == null)
			paramHashtable.put("title", "slide");
		if (paramHashtable.get("admin") == null)
			paramHashtable.put("admin", "welcome");
		if (paramHashtable.get("window") == null)
			paramHashtable.put("window", "0");
		if (paramHashtable.get("encoding") == null)
			paramHashtable.put("encoding", "ISO-8859-1");
		if (paramHashtable.get("mode") == null)
			paramHashtable.put("mode", "0");
		if (paramHashtable.get("pages") == null)
			paramHashtable.put("pages", "0");
		if (paramHashtable.get("fastclick") == null)
			paramHashtable.put("fastclick", "0");
		if (paramHashtable.get("frame1") == null)
			paramHashtable.put("frame1", "65%,35%");
		if (paramHashtable.get("frame2") == null)
			paramHashtable.put("frame2", "80,*");
		if (paramHashtable.get("frame3") == null)
			paramHashtable.put("frame3", "80%,20%");
		if (paramHashtable.get("chatwindow1") == null)
			paramHashtable.put("chatwindow1", "width=530,height=400,location=no,toolbar=no,menubar=no,scrollbars=yes,resize=yes,top=30,left=30");
		if (paramHashtable.get("chatwindow2") == null)
			paramHashtable.put("chatwindow2", "width=630,height=400,location=no,toolbar=no,menubar=no,scrollbars=yes,resize=yes,top=30,left=30");
		if (paramHashtable.get("dhtml") == null)
			paramHashtable.put("dhtml", "1");
		if (paramHashtable.get("msglen") == null)
			paramHashtable.put("msglen", "35");
		if (paramHashtable.get("logout") == null)
			paramHashtable.put("logout", "0");
		if ((str = (String) paramHashtable.get("chat")) == null) {
			paramHashtable.put("chat", "0");
		} else if ((!(str.equals("1"))) && (!(str.equals("2")))) {
			paramHashtable.remove("chat");
			paramHashtable.put("chat", "0");
		}
		if ((str = (String) paramHashtable.get("dir")) != null) {
			paramHashtable.put("dir1", str);
			if (!(str.endsWith(separator))) {
				str = str + separator;
				paramHashtable.remove("dir");
				paramHashtable.put("dir", str);
			}
			try {
				File localFile = new File(str);
				String[] arrayOfString = localFile.list();
				if (arrayOfString == null)
					paramHashtable.remove("dir");
			} catch (Exception localException2) {
				paramHashtable.remove("dir");
			}
		}
		if ((str = (String) paramHashtable.get("timeout")) == null) {
			paramHashtable.put("timeout", "15000");
		} else {
			int i;
			try {
				i = Integer.parseInt(str) * 1000;
			} catch (Exception localException3) {
				i = -1;
			}
			paramHashtable.remove("timeout");
			if (i <= 0)
				paramHashtable.put("timeout", "15000");
			else
				paramHashtable.put("timeout", "" + i);
		}
		if ((str = (String) paramHashtable.get("timeout1")) == null) {
			paramHashtable.put("timeout1", "10000");
		} else {
			int i;
			try {
				i = Integer.parseInt(str) * 1000;
			} catch (Exception localException4) {
				i = -1;
			}
			paramHashtable.remove("timeout1");
			if (i <= 0)
				paramHashtable.put("timeout1", "10000");
			else
				paramHashtable.put("timeout1", "" + i);
		}
		if ((str = (String) paramHashtable.get("messages")) == null) {
			paramHashtable.put("messages", "30");
		} else {
			int i;
			try {
				i = Integer.parseInt(str);
			} catch (Exception localException5) {
				i = -1;
			}
			if (i <= 0) {
				paramHashtable.remove("messages");
				paramHashtable.put("messages", "30");
			}
		}
		prepareDictionary(paramHashtable);
		return bool;
	}

	private void prepareDictionary(Hashtable paramHashtable) {
		Hashtable localHashtable = new Hashtable();
		localHashtable.put("Topic", "Topic");
		localHashtable.put("Url", "URL");
		localHashtable.put("File", "File");
		localHashtable.put("Script", "Script");
		localHashtable.put("Chat", "Chat");
		localHashtable.put("Logout", "Logout");
		localHashtable.put("Clear", "Clear cache");
		localHashtable.put("Read script", "Read");
		localHashtable.put("Read file", "Read");
		localHashtable.put("Go", "Go");
		String str = (String) paramHashtable.get("translation");
		if (str != null)
			loadDictionary(str, localHashtable);
		paramHashtable.put("lbldctnr", localHashtable);
	}

	private String getLabel(Hashtable hashtable, String string) {
		return (String) ((Hashtable) hashtable.get("lbldctnr")).get(string);
	}

	private void loadDictionary(String paramString, Hashtable paramHashtable) {
		try {
			BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(paramString)));
			String str;
			while ((str = localBufferedReader.readLine()) != null) {
				str = str.trim();
				if (str.length() <= 0)
					continue;
				int i = str.indexOf("=");
				if ((i <= 0) || (i >= str.length() - 1) || (str.charAt(0) == '#') || (str.startsWith("//")))
					continue;
				paramHashtable.put(str.substring(0, i).trim(), str.substring(i + 1).trim());
			}
			localBufferedReader.close();
		} catch (Exception localException) {
		}
	}

	private void logData(String paramString1, String paramString2, String paramString3, String paramString4) {
		String str = paramString1 + "\t" + paramString3 + "\t" + paramString4 + "\t" + new Date() + NEWLINE;
		synchronized (SessionIdLock) {
			try {
				FileWriter localFileWriter = new FileWriter(paramString2, true);
				localFileWriter.write(str);
				localFileWriter.close();
			} catch (Exception localException) {
			}
		}
	}

	private void logData1(String paramString1, String paramString2, String paramString3, String paramString4) {
		String str = paramString1 + "\t" + paramString3 + "\t" + paramString4 + "\t" + new Date() + NEWLINE;
		synchronized (SessionIdLock) {
			try {
				FileWriter localFileWriter = new FileWriter(paramString2, true);
				localFileWriter.write(str);
				localFileWriter.close();
			} catch (Exception localException) {
			}
		}
	}
}
